<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>首页</title>
  <link rel="stylesheet"  href="/thinkphp1/Public/Css/admin.css"/>
</head>
<body>
      <div class="top">
          <div class="t_main w mt">
            <span><b>WE TEAM</b>商城后台管理系统</span>
            <div class="t_right fr">
              欢迎
              <?php echo $_SESSION['admin']['name']; ?>
              <a href="<?php echo U('Login/loginout');?>">❤退出❤</a>
            </div>
          </div>
      </div>
      <div class="main">
        <div class="main_left fl">
          <ul>
            <a href="<?php echo U('Goods/Index');?>">
              <li>
                <span class="lm_ico"></span>
                <b>商品管理</b>
                <span class="left_ico"></span>  
              </li>
              </a>
              <a href="<?php echo U('Category/Index');?>">
                <li>
                  <span class="lm_ico"></span>
                  <b>分类管理</b>
                  <span class="left_ico"></span>
                </li>
              </a>
              <a href="<?php echo U('User/index');?>">
                <li>
                  <span class="lm_ico"></span>
                  <b>用户管理</b>
                  <span class="left_ico"></span>
                </li>
              </a>
              <a href="<?php echo U('Order/index');?>">
                <li>
                  <span class="lm_ico"></span>
                  <b>订单管理</b>
                  <span class="left_ico"></span>
                </li>
              </a>
              <a href="<?php echo U('Arguments/index');?>">
                <li>
                  <span class="lm_ico"></span>
                  <b>评论管理</b>
                  <span class="left_ico"></span>
                </li>
              </a>
              <a href="<?php echo U('Addver/index');?>">
                <li>
                  <span class="lm_ico"></span>
                  <b>广告管理</b>
                  <span class="left_ico"></span>
                </li>
              </a>
            </ul>
          </div>
          <div class="main_right fr">
        <div class="main_m">
            
	<div class="agoods_nav">
		<span>商品列表</span>
	</div>
	<a href="<?php echo U('Goods/add');?>"><button style="width:100px;height:40px;border:none;background:#DC5448;">添加商品</button></a>
	<table class="table"  border="1" cellspacing="0" cellpadding="5" align="center">
		<tr>
			<th colspan="8">
				<form action="<?php echo U('Goods/like');?>"  method="get">
				<input type="text" name="like" />
				<button>搜索</button>
				</form>
			</th>
		</tr>

		<tr bgcolor="#ccc">
			<th>编号</th>
			<th>商品名</th>
			<th>图片</th>
			<th>价格</th>
			<th>上架</th>
			<th>热销</th>
			<th>新品</th>
			<th>操作</th>
		</tr>
		<?php if(is_array($list)): foreach($list as $key=>$val): ?><tr>
				<td><?php echo ($val['gid']); ?></td>
				<td><?php echo ($val['gname']); ?></td>
				<td><img src="/thinkphp1<?php echo ($val['giname']); ?>" alt=""> </td>
				<td style="color:red">
				￥:<?php echo ($val['gp']); ?>
				</td>
				<td>
					<?php if($val['gb'] == 1): ?><a style="color:red" href="<?php echo U('Goods/Status',['id'=>$val['gid'],'is_bast'=>$val['gb']]);?>">
							 上架</a>
						<?php else: ?> 
							 <a style="color:blue" href="<?php echo U('Goods/Status',['id'=>$val['gid'],'is_bast'=>$val['gb']]);?>">下架</a><?php endif; ?>
				</td>
				<td>	
					<?php if($val['ghot'] == 1): ?><a style="color:red" href="<?php echo U('Goods/Status',['id'=>$val['gid'],'is_hot'=>$val['ghot']]);?>">
							 热销</a>
						<?php else: ?> 
							 <a style="color:blue" href="<?php echo U('Goods/Status',['id'=>$val['gid'],'is_hot'=>$val['ghot']]);?>">不热销</a><?php endif; ?>
				</td>
				<td>
					<?php if($val['gnew'] == 1): ?><a style="color:red" href="<?php echo U('Goods/Status',['id'=>$val['gid'],'is_new'=>$val['gnew']]);?>">
							 新品</a>
						<?php else: ?> 
							 <a style="color:blue" href="<?php echo U('Goods/Status',['id'=>$val['gid'],'is_new'=>$val['gnew']]);?>">非新品</a><?php endif; ?>
				</td>
				<td><a href="<?php echo U('Goods/deleted',['id'=>$val['gid']]);?>">删除</a>|<a href="<?php echo U('Goods/more',['id'=>$val['gid']]);?>">查看详情</a></td>
			</tr><?php endforeach; endif; ?>
			<tr>
				<td colspan="8"><?php echo ($page); ?></td>
			</tr>
	</table>

        </div>  
      </div>
        </div>
        <div id="footer">
          
        </div>
        </body>
      </html>